package com.nulldev.util.web.npswitcher;

import java.awt.SystemTray;
import java.awt.Toolkit;

import javax.imageio.ImageIO;

import com.nulldev.util.io.FileUtil;
import com.nulldev.util.java.JVMUtil;
import com.nulldev.util.java.swing.utils.MultiLineToolTipUI;

public class nProxySwitcher {

	public static void main(String[] args) throws Exception {
		JVMUtil.setArgs(args);
		
		MultiLineToolTipUI.installUI();
		final nProxySwitcherTray TRAY = nProxySwitcherTray.createInstance();
		if (SystemTray.isSupported()) {
			TRAY.setImage(Toolkit.getDefaultToolkit().getImage(nProxySwitcherUI.class.getResource("/com/nulldev/util/java/swing/nullutil_logo.png")));
			SystemTray.getSystemTray().add(TRAY);
		}
		if (!FileUtil.safeCreate(FileUtil.HOME_DIRECTORY + "/nProxySwitcher/").isDirectory()) {
			FileUtil.safeCreate(FileUtil.HOME_DIRECTORY + "/nProxySwitcher/").mkdirs();
		}
		nProxySwitcherUI.main();
	}

}
